package com.peng.diy;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.stereotype.Component;
@Component
@Aspect
public class AnnocationPoint {
    @Before("execution(* com.peng.service.ServiceImpl.*(..))")
    public void before(){
        System.out.println("=====");
    }
    @Around("execution(* com.peng.service.ServiceImpl.*(..))")
    public void around(ProceedingJoinPoint pj){
        System.out.println("环绕前");
        try {
            Object proceed = pj.proceed();
        } catch (Throwable e) {
            e.printStackTrace();
        }
        System.out.println("环绕后");
    }
}
